fix: deep audit PR B — API-gate bypass, broken-stack conflation, duplicated import walls#37
Merged
Merged
Conversation
…walls Three confirmed tooling bugs from the phase-A audit (issue #35): 1. The documented per-command bypass (PYAUTO_SKIP_API_GATE=1 as a command prefix) could never work — the hook read only its own process env. The hook now also detects the prefix in the command text. 2. A stack that fails to import (e.g. the workspace version check) marked every symbol STALE and repeated the full multi-paragraph import error once per symbol. validate_source now separates import-failed roots (truncated, reported once) from genuine staleness; the gate exits 3 (INSTALL_IMPORT_FAILED) instead of 2 and the hook fails open on it — the command surfaces the same import error itself, and a broken env is not API drift. 3. --check-install/--check-version printed the identical import wall once per library (3x for a version mismatch); identical errors are now grouped and printed once, naming all affected modules. Also: Makefile gains audit/test targets; the gate skill documents the exit-3 contract and both bypass forms. Three new regression tests pin the fixes; full tooling suite 39 passed. The version pin (2026.5.29.4 vs installed dev build) is deliberately untouched — version.txt is release-owned and hand-bumping it would fake a release state. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #35 (deep audit, phase B of C — do not auto-close). Tooling robustness: fixes the three gate/audit bugs confirmed during the phase-A skill review.
What changed
PYAUTO_SKIP_API_GATE=1as a command prefix now works. The hook only read its own process env, so the escape hatch documented in AGENTS.md and the gate skill could never fire per-command. The prefix is now detected in the command text (.claude/hooks/validate_pyauto_code.py).validate_sourcenow separates import-failed roots (reported once, truncated to 200 chars) from genuine staleness;--code/--fileexit 3 (INSTALL_IMPORT_FAILED) instead of 2, and the hook fails open on exit 3 — the command surfaces the same import error itself. Previously every symbol was marked STALE with the full multi-paragraph error repeated per symbol.--check-install/--check-versiongroup identical errors: one message naming all affected modules, instead of the same wall three times.audit/testtargets;al_audit_skill_apis.mddocuments the exit-3 contract and both bypass forms.Validation
--codeexit 3 with the concise environment message).Deliberately not changed
version.txtpin (2026.5.29.4 vs installed 2026.7.6.649, the standing Heart finding) — release-owned; PyAutoBuild stamps it when a release regenerates the baseline. Hand-bumping against a main dev build would fake a release state. The mismatch error itself documents theworkspace_version_check: Falseremedy for main-tracking users.activate.sh,config/— reviewed, sound.🤖 Generated with Claude Code